-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Placeholder: Refactor and simplify dashed placeholders used for Featured Image & Site Logo #43228
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jasmussen
added
[Type] Enhancement
A suggestion for improvement.
CSS Styling
Related to editor and front end styles, CSS-specific issues.
[Block] Post Featured Image
Affects the Post Featured Image Block
[Block] Site Logo
Affects the Site Logo Block
labels
Aug 15, 2022
This was referenced Aug 15, 2022
Size Change: -1.1 kB (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
jameskoster
approved these changes
Aug 15, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working as promised for me
27 tasks
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Block] Post Featured Image
Affects the Post Featured Image Block
[Block] Site Logo
Affects the Site Logo Block
CSS Styling
Related to editor and front end styles, CSS-specific issues.
Needs User Documentation
Needs new user documentation
[Type] Enhancement
A suggestion for improvement.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Site Logo and Featured Image blocks feature a new style of placeholder, a more literal one that is meant to inherit colors, radius, dimensions and more from its surroundings. These:
This PR does a few things:
Here's the end result, 3 GIFs showing the same dashed outlines as before, on 3 different background colors:
Why?
The opacity change is made for two reasons. In part, it enhances contrast a bit. Secondly, it solves an issue where adding border-support to this placeholder revealed an inherited radius issue, discussed in depth here. For such a border inheritance to work, the border has to be fully opaque (to put it shortly, we can't do
rgba(currentColor, 0.4)
).The refactor was done because we are increasingly seeing a need for placeholders to inherit qualities from their surroundings. By reducing duplicated code, we can more simply expand this style of placeholders, for example to the Image block which could be next. See #41142, #43180 and WordPress/twentytwentythree#30.
Testing Instructions
Test site logo, featured image blocks, ideally in a variety of color schemes and in context of other blocks, and outside of a more opaque border, things should look the same.